<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2015/12/3
 * Time: 21:37
 */

/**
 * 得到
 */

//echo "returndata<br>";
//echo "<pre>";
//print_r($_REQUEST);
//echo "</pre>";

define('UPLOAD_PATH', dirname(__FILE__).'/upload');

//echo '__FILE__='.__FILE__.'<br>';

//var_dump($_POST);

//echo '<br>';

//$name = $_POST['name'];
//$gender = $_POST['gender'];
//
$filename = time().'.jpg';

//echo 'name='.$name.'<br>';
//echo 'gender='.$gender.'<br>';
var_dump($_FILES) ;
echo '<br>';
var_dump($_POST);
echo '<br>';
var_dump($_REQUEST);
echo '<br>';

sleep(1);

//echo 'liudashi='.$_FILES['ludashi']['tmp_name'].'<br>';
if(move_uploaded_file($_FILES['ludashi']['tmp_name'], './'.$filename)){
    //echo '<img src="./'.$filename.'">';
    echo "./'.$filename.'";
}

//$filename="teststream.jpg";//要生成的图片名字
//
//$xmlstr =  $GLOBALS[HTTP_RAW_POST_DATA];
//if(empty($xmlstr)) $xmlstr = file_get_contents('php://input');
//
//$jpg = $xmlstr;//得到post过来的二进制原始数据
//$file = fopen("cache/pic/".$filename,"w");//打开文件准备写入
//fwrite($file,$jpg);//写入
//fclose($file);//关闭